﻿<MRow>
    <MCol>
        <MCard>
            <MCardTitle>
                材料余量
            </MCardTitle>

            <MCardText>@MainState.MaterialCount</MCardText>

            @if (replaceMaterialStates.IsRunning)
            {
                <MCardText>@replaceMaterialStates.GetStateInfo()</MCardText>
            }

            <MCardActions>
                <MButton OnClick="StartReplaceMaterial" Disabled=@(!CanExecuteReplaceMaterial())>
                    @replaceMaterialStates.GetStartButtonText()
                </MButton>
                @if (!replaceMaterialStates.IsInitState)
                {
                    <MButton OnClick="ExecuteCancelReplaceMaterial">取消</MButton>
                }

                <MSlider @bind-Value="replaceMaterialStates.ChangeStateInterval"
                         Max="5" Min="1" Label="时间间隔(s)" ThumbLabel="@("always")"
                         Step="1"></MSlider>
            </MCardActions>
        </MCard>
    </MCol>

    <MCol>
        <MCard>
            <MCardTitle>材料详情</MCardTitle>
            <MCardText>
                <MProgressLinear Value="@IceCream.Default.RemainCount" Color="blue-grey" Height="25">
                    <strong>冰淇淋 @IceCream.Default.RemainCount</strong>
                </MProgressLinear>

                <MProgressLinear Value="@Strawberry.Default.RemainCount" Color="pink" Height="25">
                    <strong>草莓 @Strawberry.Default.RemainCount</strong>
                </MProgressLinear>

                <MProgressLinear Value="@Chocolates.Default.RemainCount" Color="amber" Height="25">
                    <strong>巧克力 @Chocolates.Default.RemainCount</strong>
                </MProgressLinear>
            </MCardText>
        </MCard>
    </MCol>
</MRow>

<MRow>
    <MCol>
        <MCard>
            <MCardTitle>窗口1</MCardTitle>

            <MCardText>@makeFirstStates.GetStateInfo()</MCardText>
            <MCardActions>
                <MButton OnClick="StartMakeFirst" Disabled=@(!CanExecuteMakeFirst())>
                    @makeFirstStates.GetStartButtonText()
                </MButton>
                @if (!makeFirstStates.IsInitState)
                {
                    <MButton OnClick="ExecuteCancelWindow1">取消</MButton>
                }

                <MSlider @bind-Value="makeFirstStates.ChangeStateInterval"
                         Max="5" Min="1" Label="时间间隔(s)" ThumbLabel="@("always")"
                         Step="1"></MSlider>
            </MCardActions>

        </MCard>
    </MCol>
    <MCol>
        <MCard>
            <MCardTitle>窗口2</MCardTitle>

            <MCardText>@makeSecondStates.GetStateInfo()</MCardText>
            <MCardActions>
                <MButton OnClick="StartMakeSecond" Disabled=@(!CanExecuteMakeSecond())>
                    @makeSecondStates.GetStartButtonText()
                </MButton>
                @if (!makeSecondStates.IsInitState)
                {
                    <MButton OnClick="ExecuteCancelWindow2">取消</MButton>
                }

                <MSlider @bind-Value="makeSecondStates.ChangeStateInterval"
                         Max="5" Min="1" Label="时间间隔(s)" ThumbLabel="@("always")"
                         Step="1"></MSlider>
            </MCardActions>
        </MCard>
    </MCol>
</MRow>
